import { createBrowserRouter } from 'react-router-dom'
import { createElement } from 'react'
import Layout from '@/pages/Layout/index'
import Meeting from '@/pages/Meeting/index'
import Shop from '@pages/Shop/index'
import Photo from '@/pages/Photo/index'
import ShopDetails from '@/pages/Shop/details'
import Login from '@/pages/login'
import AddLogin from '@/pages/login/add'
import updatePsw from '@/pages/login/update'
import Add from '@/pages/Shop/details/add'
import Edit from '@/pages/Shop/details/edit'
import EditMerchant from '@/pages/Shop/details/editMerchant'
import BatchExport from '@/pages/Shop/export'
import MeetingAdd from '@/pages/Meeting/add'
import AddMerchant from '@/pages/Shop/details/addMerchant'
import MeetingDetails from '@/pages/Meeting/details'
import Users from '@/pages/Users'
import Rectification from '@/pages/Shop/details/rectification'
import Types from '@/pages/Shop/types'
import Show from '@/pages/show'

const router = createBrowserRouter([
    {
        path: '/',
        element: createElement(Layout, {}, null),
        children: [
            { index: true, element: createElement(Shop, {}, null) },
            { path: 'meeting', element: createElement(Meeting, {}, null) },
            { path: 'photo', element: createElement(Photo, {}, null) },
            { path: 'shop/:shopId', element: createElement(ShopDetails, {}, null) },
            { path: 'shop/:shopId/add', element: createElement(Add, {}, null) },
            { path: 'shop/:shopId/edit', element: createElement(Edit, {}, null) },
            { path: 'shop/:shopId/editMerchant', element: createElement(EditMerchant, {}, null) },
            { path: 'shop/addMerchant', element: createElement(AddMerchant, {}, null) },
            { path: 'exports', element: createElement(BatchExport, {}, null) },
            { path: 'meeting/add/:meetingId?', element: createElement(MeetingAdd, {}, null) },
            { path: 'meeting/details/:meetingId', element: createElement(MeetingDetails, {}, null) },
            { path: 'users', element: createElement(Users, {}, null) },
            { path: 'shop/:shopId/rectification', element: createElement(Rectification, {}, null) },
            { path: 'shop/types', element: createElement(Types, {}, null) }
        ]
    },
    {
        path: '/login',
        element: createElement(Login, {}, null)
    },
    {
        path: '/add',
        element: createElement(AddLogin, {}, null)
    },
    {
        path: '/update',
        element: createElement(updatePsw, {}, null)
    },
    {
        path: '/show',
        element: createElement(Show, {}, null)
    },
])

export default router
